package com.example.webdownloadserver.common;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 
 * <p>
 * 下载任务全局参数
 * </p>
 * @title TaskConstants.java
 * @package com.dnkj.download.task.base 
 * @author ying.xiao
 * @version 0.1 2020年12月5日
 */
@Data
@Component
public class TaskConstants{

	// 任务类型：D-下载
	public static String TASK_TYPE_D = "D";
	
	// 任务类型：U-上传
	public static String TASK_TYPE_U = "U";
	
	public static String DOWNLOAD_SUCC = "下载成功";
	
	public static String DOWNLOAD_DEALSUCC_NODATA = "处理成功[查无数据]";
	
	public static String DOWNLOAD_IOEERROR = "文件写入异常";
		
	public static String DOWNLOAD_ERROR = "下载异常";
	
	public static String UPLOAD_DO_ERROR = "上传文件处理异常";
	
	//下载文件保存路径
	public static String DOWNLOADPATH;

	public static String UPLOADPATH;



	@Value("${downloadPath}")
	public String downloadPath;

	@Value("${uploadPath}")
	public String uploadPath;

	@PostConstruct
	public void setDownloadPath() {
		DOWNLOADPATH = this.downloadPath;
		UPLOADPATH = this.uploadPath;
	}
}
